home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 34 / Amiga Format CD34 (1998-11-20)(Future Publishing)(GB)[!][Christmas issue].iso / -seriously_amiga- / programming / basic / blitzc2p / game / rupture / rupture.ascii < prev    next >
Text File  |  1998-10-01  |  3KB  |  77 lines

  1. WBStartup
  2.  
  3. ;Main
  4.  
  5. DEFTYPE.w
  6.  
  7. INCLUDE "Prefs.bb2"
  8. INCLUDE "Variables.bb2"
  9. INCLUDE "Display.bb2"
  10.  
  11. InitPalette 0,256
  12. For c=1 To 255: AGAPalRGB 0,c,Rnd(255),Rnd(255),Rnd(255) : Next c
  13. If InitDisplay{"Rupture"}=False Then Goto Finish
  14. If InitBackground{"Default"}=False Then Goto Finish
  15. If InitLand{"Default"}=False Then Goto Finish
  16. Multitasking{Off}
  17. buf=0
  18. YAdder=-1
  19. XAdder=60
  20. While Joyb(0)=0 AND Joyb(1)=0
  21.   If PrefDisplayBuffering=2 Then buf=1-buf ; Only works for doublebuffered display
  22.   If NumberOfPlayers=1
  23.     If PrefBackdrop
  24. ChunkyCopy16{BackgroundBase+(PrefDisplayWidth*BGPos(1)),ChunkyBuffer,GameHeight,CPUminimum,PrefDisplayWidth,PrefDisplayWidth}
  25.     Else
  26.       ChunkyClearscreen32{ChunkyBuffer,GameHeight,ClearScreenTo,PrefDisplayWidth}
  27.     EndIf
  28.     LandCopy16{LandBase,LandBuffer,LandPos(1),PrefDisplayWidth,PrefDisplayWidth}
  29.     ChunkyClearscreen4{ChunkyBuffer,PrefDisplayHeight,PrefDisplayWidth,PrefDisplayWidth,0}
  30.   EndIf
  31.   If NumberOfPlayers=2
  32.     If PrefBackdrop
  33. ChunkyCopy16{BackgroundBase+(PrefDisplayWidth*BGPos(1)),ChunkyBuffer,GameHeight,CPUminimum,DisplaySplit,PrefDisplayWidth}
  34.       a.l=BackgroundBase+(PrefDisplayWidth*BGPos(2))+DisplaySplit
  35.       b.l=ChunkyBuffer+DisplaySplit
  36.       ChunkyCopy16{a,b,GameHeight,CPUminimum,PrefDisplayWidth-DisplaySplit,PrefDisplayWidth}
  37.     Else
  38.       ChunkyClearscreen32{ChunkyBuffer,GameHeight,ClearScreenTo,PrefDisplayWidth}
  39.     EndIf
  40.     LandCopy16{LandBase,LandBuffer,LandPos(1),DisplaySplit,PrefDisplayWidth}
  41.     LandCopy16{LandBase,LandBuffer+DisplaySplit,LandPos(2),PrefDisplayWidth-DisplaySplit,PrefDisplayWidth}
  42.     ChunkyClearscreen4{ChunkyBuffer,PrefDisplayHeight,DisplaySplit,PrefDisplayWidth,Clear4}
  43.     ChunkyClearscreen4{ChunkyBuffer,PrefDisplayHeight,PrefDisplayWidth,PrefDisplayWidth,0}
  44.   EndIf
  45.  
  46.   ;Player 1 control
  47.   LandPos(1)-1
  48.   XAdder+Joyx(1)*2
  49.   LandPos(1)+XAdder
  50.   YAdder+Joyy(1)*2
  51.   If XAdder<0 AND buf=0 Then XAdder+1
  52.   If XAdder>0 AND buf=0Then XAdder-1
  53.   If YAdder<-1 AND buf=0Then YAdder+1
  54.   If YAdder>1 AND buf=0Then YAdder-1
  55.   If LandPos(1)>=#LandWidth Then LandPos(1)-#LandWidth
  56.   If LandPos(1)<0 Then LandPos(1)+#LandWidth
  57.   If BGPos(1)>=BGHeight Then BGPos(1)-BGHeight
  58.   If BGPos(1)<0 Then BGPos(1)+BGHeight
  59.  
  60.   ;Player 2 control
  61.   LandPos(2)+4
  62.   If LandPos(2)>=#LandWidth Then LandPos(2)-#LandWidth
  63.   If LandPos(2)<0 Then LandPos(2)+#LandWidth
  64.   BGPos(1)+YAdder
  65.   BGPos(2)-1
  66.   If BGPos(2)>BGHeight Then BGPos(2)-BGHeight
  67.   If BGPos(2)<0 Then BGPos(2)+BGHeight
  68.  
  69.   VWait
  70.   Display{buf}
  71. Wend
  72.  
  73. Finish:
  74. Multitasking{On}
  75. If IsAGA Then FreeAGA{} ; Restore hacked AGA bitmaps for safe freeing
  76. End
  77.